package exception;

public class Demo2 {
    public static void main(String[] args) {
        func();
        System.out.println("try-catch之后的代码...");
    }
    public static void main1(String[] args) {
        try{
            func();
        }catch(ArrayIndexOutOfBoundsException e){
            e.printStackTrace();
        }
        System.out.println("try-catch之后的代码...");
    }
    public static int func(){
        int array[] = {1,2,3};
        return array[3];
    }
}
